import api from './index'

export const activitiesApi = {
  getMyActivities: (params) => api.get('/activities/my', { params }),
  list: (params) => api.get('/activities/list', { params }),
  getById: (id) => api.get(`/activities/${id}`),
  create: (data) => api.post('/activities', data),
  update: (id, data) => api.put(`/activities/${id}`, data),
  delete: (id) => api.delete(`/activities/${id}`),

  // 审核与统计（管理员）
  review: (id, data) => api.post(`/activities/${id}/review`, data),
  stats: (params) => api.get('/activities/stats', { params }),

  // 附件
  uploadAttachment: (id, formData) => api.post(`/activities/${id}/attachments`, formData, {
    headers: { 'Content-Type': 'multipart/form-data' }
  }),
  listAttachments: (id) => api.get(`/activities/${id}/attachments`),
  deleteAttachment: (attachmentId) => api.delete(`/activities/attachments/${attachmentId}`)
}

export default activitiesApi 